package com.atues.extendinter;

public class Dog extends Animal{
    String name;
    public Dog() {
    }

    @Override
    public void screem() {

//        System.out.println("age"+this.age+ "汪汪汪");//无法访问父类的私有属性和私有方法
        System.out.println("age"+super.sex+  "  " +super.weight+ "汪汪汪");//protected可以访问

    }

    public Dog(int age, double weight,int sex ,String name) {
        super(age, weight, sex);
        this.name = name;
    }

    public void jump(){
        System.out.println("狗跳");
    }
}
